<template>
<!-- 流转日志 -->
<div class="order-logs">
  <van-steps direction="vertical" :active="0" active-color="#38f">
    <van-step v-for="(item, index) in logList" :key="index">
      <div class="item-status">{{ item.taskName }}</div>
      <div class="item-head">
        <div class="name">{{ item.wfActor }}</div>
        <div class="time">{{ item.createDate }}</div>
      </div>
      <div class="item-org">{{ item.wfActorDept }}</div>
      <div class="item-desc">处理意见：{{ item.auditIdea || '无' }}</div>
    </van-step>
  </van-steps>
</div>
</template>

<script>
import { orderLog } from '@/api/order.js'

export default {
  data() {
    return {
      logList: []
    }
  },
  mounted() {
    this.getLogs()
  },
  methods: {
    async getLogs() {
      const res = await orderLog({ orderId: this.$route.query.orderId })
      const { success, result } = res
      if(success) {
        this.logList = result
      }
    }
  }
}
</script>
<style lang="less" scoped>
.order-logs {
  background: #ffffff;
  box-shadow: 0 2px 4px 1px #f3f7fa;
  border-radius: 6px;
  padding: 12px 8px;
  margin: 6px 8px;
  .item-status {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 13px;
  }
  .item-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
  }
  .item-org {
    margin-bottom: 4px;
    font-size: 13px;
  }
  .item-desc {
    font-size: 13px;
  }
}
</style>
